#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

void solve() {
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    map<char, int> mp;
    for(auto ch : s) {
        mp[ch]++;
    }
    int m = (n - k) & 1;
    k += m;
    for(auto [x, v] : mp) {
        if(v & 1){
            if(k == 0) {
                cout << "NO\n";
                return;
            }
            k--;
        }
    }
    if(k & 1) {
        cout << "NO\n";
    }else{
        cout << "YES\n";
    }
}

int main() {
    int t;
    cin >> t;
    while(t--) solve();
    return 0;
}